package com.hirstlogics.boxarrow.box;

import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

/* The name of a box hand can either be a reference to another box
 * in which case the value is named box 
 * or if there can be no box with that name it is the literal box of that name
 */
public class BoxHandle extends AtomicBox {
	
	/* Create a handle for another box */
	public BoxHandle(Box handleFor) {
		name = handleFor.getName();
	}
    	
	/* resolve the reference to the box whose handle this is */
	public Box resolve() {
		return null;
	}

	@Override
	public void readContents(XMLStreamReader read) {
		try {
			name = read.getElementText();
		} catch (XMLStreamException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
